#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.59])
AC_INIT([eGeard], [0.1.0], [xijiaosdq@gmail.com])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_AUX_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror gnu])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB

CPPFLAGS="${CPPFLAGS} -I/usr/include/boost-1_37"
LDFLAGS="${LDFLAGS} -L/usr/lib/boost-1_37"

# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create],
	     [], [AC_MSG_ERROR("-lpthread not found")])
AC_CHECK_LIB([boost_iostreams], [main],
	     [], [AC_MSG_ERROR("-lboost not found")])
AC_CHECK_LIB([boost_system], [main],
	     [], [AC_MSG_ERROR("-lboost not found")])
AC_CHECK_LIB([mysqlclient], [main],
	     [], [AC_MSG_ERROR("-lmysqlclient not found")])

# Checks for header files.
AC_CHECK_HEADERS([mysql.h])
AC_CHECK_HEADERS([asio.hpp])


# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_CHECK_FUNCS([mkdir])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])

#BOOST_MIN_VERSION=1.35.0

#AX_BOOST_BASE([$BOOST_MIN_VERSION])
#AX_BOOST_IOSTREAMS([$BOOST_MIN_VERSION])
#AX_BOOST_SYSTEM([$BOOST_MIN_VERSION])
#AX_BOOST_THREAD([$BOOST_MIN_VERSION])
#AX_BOOST_REGEX([$BOOST_MIN_VERSION])

AC_OUTPUT
